<!DOCTYPE html>
<html lang="en">
<head th:include="certificateWeb/headFoot :: headerCss">
</head>
<link rel="stylesheet" href="/css/certificateWeb/stationApplyFor/stationApplyFor.css">
<body id="body">
<div th:include="certificateWeb/headFoot :: header"></div>
<style>
    .line {
        text-align: center;
        border-bottom: 1px solid #CFCFCF;
        clear: both;
        margin-top: 20px
    }

    .span_1 {
        width: 180px
    }

    .cd {
        width: 130px;
        display: inline-block;
        margin: 20px auto auto auto;
    }

    .dong {
        width: 55px;
        display: inline-block;
        margin: 20px auto auto auto;
    }

    .jshi {
        width: 55px;
        display: inline-block;
        margin: 20px auto auto auto;
    }

    .addBtn {
        width: 440px;
        height: 35px;
        background-color: #dddee1;
        border-radius: 3px;
        margin: 20px auto 20px 95px;
        color: #515c34;
        font-weight: bold;
        border: 0px;
    }

    .del {
        width: 55px;
        color: #00b7ee;
        background-color: #dddee1;
        margin-left: 15px;
        display: inline-block;
        border-radius: 3px;
        text-align: center;
        font-size: 16px;
        line-height: 25px;
        margin-top: 34px;
    }
</style>
<main id="main">
    <section class="sec_1">
        <div class="div_1">
            <ul>
                <li class="" th:classappend="${profileName=='幼儿照护职业技能等级证书'?'this':''}" id="a1"><a href="/certificate/testingCentreApplyFor?type=5&profileName=幼儿照护职业技能等级证书">幼儿照护考核站点申请</a></li>
                <li class="" th:classappend="${profileName=='产后恢复职业技能等级证书'?'this':''}" id="a2"><a href="/certificate/testingCentreApplyFor?type=6&profileName=产后恢复职业技能等级证书">产后恢复考核站点申请</a></li>
                <li  id="b1"><a href="/certificate/testingCentreApplyForPx?type=1">培训基地申请</a></li>
            </ul>
        </div>
        <div class="div_2" id="testingBox">
            <label class="label_title">考核站点申请</label>
            <hr/>
            <div id="edit"></div>
            <!--            <form id="formId">-->
            <div class="line">考评基本情况</div>
            <span th:each="xz:${consultations}">
                    <input type="hidden" id="cnsFile" th:value="${xz.files}"/>
                    <input type="hidden" id="cnTitle" th:value="${xz.title}"/>
             </span>
            <div class="div_3">
                <label class="span_1">单位所属省份<span style="color: #D52525">*</span>：</label>
                <div id="adre">
                    <select class="form-control inp_1" id="province" name="province">
                    </select>
                </div>
            </div>
            <div class="div_3">
                <label class="span_1">单位名称<span style="color: #D52525">*</span>：</label>
                <input type="text" name="name" th:value="${orgName}" id="name" placeholder="请输入机构名称"
                       class="form-control inp_1"/>
            </div>
            <div class="div_3">
                <label class="span_1">考评证书<span style="color: #D52525">*</span>：</label>
                <input type="text" name="profileName" th:value="${profileName}" id="profileName"
                       class="form-control inp_1" disabled/>

            </div>
            <div class="div_3">
                <label class="span_1">已批准的考核计划(人)<span style="color: #D52525">*</span>：</label>
                <input type="number" id="numberOfExaminees" placeholder="请输入已批准的考核计划(人)" name="numberOfExaminees"
                       class="form-control inp_1"/>
            </div>
            <div class="line">考评团队</div>
            <div id="info">

            </div>
        </div>
        <div style="clear: both"></div>
        <input type="hidden" id="applicationEndTime" th:value="${applicationEndTime}"/>
        <input type="hidden" id="applicationSlogan" th:value="${applicationSlogan}"/>
    </section>
</main>
<div th:include="certificateWeb/headFoot :: footer"></div>
<script src="/js/plugins/layer/layer.min.js" th:src="@{/js/plugins/layer/layer.min.js}"></script>
<script src="/js/plugins/validate/jquery.validate.extend.js"></script>
<script type="text/javascript" src="/js/jquery-form.js"></script>
<script src="/js/jquery.citys.js"></script>
</body>
<script>
    $(function () {
        //考核站点申请截止标语及截止时间
        var applicationEndTime = $("#applicationEndTime").val();
        var applicationSlogan = $("#applicationSlogan").val();
        var changeTime = new Date(applicationEndTime.replace(/-/g, "/")).getTime();
        var totalSecond = (changeTime - Date.parse(new Date())) / 1000;
        //判断是否到截止时间
        if (applicationEndTime != '') {
            if (totalSecond < 0) {
                $("#testingBox").html('<div style="padding:10px 20px;font-size:18px">' + applicationSlogan + '</div>');
                return false
            }
        }
        ajaxToken("/jzApi/user/selUserDetail", "GET", {}, function (res) {
        });
        ajaxToken("/certificate/findOrgRolesInfo", "Post", {profileName: $("#profileName").val()}, function (res) {
            var cnFile = $('#cnsFile').val();
            var cnTitle = $('#cnTitle').val();
            var team = null;
            var equipment = null;
            var employer = null;
            var info = '';
          //  console.log("res.orgNews.province",res.orgNews.province)
            if (res.orgNews != null) {
                if (res.orgNews.province != null) {
                    $('#adre').citys({province: res.orgNews.province});
                } else {
                    $('#adre').citys({province: "请选择"});
                }

                $('#name').val(res.orgNews.name);
                $('#numberOfExaminees').val(res.orgNews.numberOfExaminees);

                if (res.orgNews.team != null && res.orgNews.equipment != null && res.orgNews.employer != null) {
                    team = JSON.parse(res.orgNews.team);
                    var kptd = '';
                    var sc1 = '';
                    team.forEach(function (item, index) {
                        if (team.length > 1) {
                            if (index != 0) {
                                sc1 = '<span class="del delkptd" id="delkptd">删除</span>';
                            } else {
                                sc1 = '';
                            }
                        }
                        var a = '';
                        if (item.kpPost == '主任') {
                            a += '<option value="主任" selected>主任</option>' +
                                ' <option value="副主任">副主任</option>' +
                                '<option value="考务考评员">考务考评员</option>' +
                                '<option value="考务技术员">考务技术员</option>'
                        } else if (item.kpPost == '副主任') {
                            a += '<option value="主任" >主任</option>' +
                                ' <option value="副主任" selected>副主任</option>' +
                                '<option value="考务考评员">考务考评员</option>' +
                                '<option value="考务技术员">考务技术员</option>'
                        } else if (item.kpPost == '考务考评员') {
                            a += '<option value="主任" >主任</option>' +
                                ' <option value="副主任">副主任</option>' +
                                '<option value="考务考评员" selected>考务考评员</option>' +
                                '<option value="考务技术员">考务技术员</option>'
                        } else if (item.kpPost == '考务技术员') {
                            a += '<option value="主任" >主任</option>' +
                                ' <option value="副主任">副主任</option>' +
                                '<option value="考务考评员">考务考评员</option>' +
                                '<option value="考务技术员" selected>考务技术员</option>'
                        } else {
                            a += '<option value="主任" >主任</option>' +
                                ' <option value="副主任">副主任</option>' +
                                '<option value="考务考评员">考务考评员</option>' +
                                '<option value="考务技术员">考务技术员</option>'
                        }
                        kptd += '<div class="kptd">' +
                            '<div class="div_3">' +
                            '                        <label class="span_1">姓名<span style="color: #D52525">*</span>：</label>' +
                            '                        <input type="text" placeholder="请输入姓名" value="' + item.khName + '" class="form-control inp_1 khName"/>' + sc1 +
                            '                    </div>' +
                            '                    <div class="div_3">' +
                            '                        <label class="span_1">职称<span style="color: #D52525">*</span>：</label>' +
                            '                        <input type="text"  placeholder="职称" value="' + item.jobName + '" class="form-control inp_1 jobName"/>' +
                            '                    </div>' +
                            '                    <div class="div_3">' +
                            '                        <label class="span_1">职务<span style="color: #D52525">*</span>：</label>' +
                            '                        <input type="text"  placeholder="职务" value="' + item.position + '" class="form-control inp_1 position"/>' +
                            '                    </div>' +
                            '                    <div class="div_3">' +
                            '                        <label class="span_1">考评岗位<span style="color: #D52525">*</span>：</label>' +
                            '                        <input type="hidden" value="' + item.kpPost + '" id="kpPost" />' +
                            '                        <select class="form-control inp_1 kpPost">' + a + '</select>' +
                            '                    </div>' +
                            '                    <div class="div_3">' +
                            '                        <label class="span_1">联系电话<span style="color: #D52525">*</span>：</label>' +
                            '                        <input type="text"  placeholder="联系电话" value="' + item.kpMobile + '" class="form-control inp_1 kpMobile"/>' +
                            '                    </div>' +
                            '                    <div class="div_3">' +
                            '                        <label class="span_1">备注：</label>' +
                            '                        <input type="text"  placeholder="备注" value="' + item.kpRemark + '" class="form-control inp_1 kpRemark"/>' +
                            '                    </div>' +
                            '</div>';
                    });
                    //考评场地设备
                    equipment = JSON.parse(res.orgNews.equipment);
                    var kpcdsb = '';
                    var sc2 = '';
                    equipment.forEach(function (item, index) {
                        if (equipment.length > 1) {
                            if (index != 0) {
                                console.log("长度 = ", index);
                                sc2 = '<span class="del delkpcd" id="delkpcd">删除</span>';
                            } else {
                                sc2 = '';
                            }
                        }
                        kpcdsb += '<div class="kpcdsb">' +
                            '                <div class="div_3">' +
                            '                    <label class="span_1">场地<span style="color: #D52525">*</span>：</label>' +
                            '                    <input type="text" value="' + item.kpSite + '"  placeholder="场地"class="form-control inp_1 kpSite"/>' + sc2 +
                            '                </div>' +
                            '                <div class="div_3">' +
                            '                    <label class="span_1">位置<span style="color: #D52525">*</span>：</label>' +
                            '                    <input type="text"  placeholder="" value="' + item.college + '" class="form-control cd college"/>学院' +
                            '                    <input type="text"  placeholder="" value="' + item.ridgepole + '" class="form-control dong ridgepole"/>栋' +
                            '                    <input type="text"  placeholder="" value="' + item.classroomNum + '" class="form-control jshi classroomNum"/>号教室' +
                            '                </div>' +
                            '                <div class="div_3">' +
                            '                    <label class="span_1">设备及设施<span style="color: #D52525">*</span>：</label>' +
                            '                    <input type="text"  placeholder="设备及设施" value="' + item.equiAndFacility + '" class="form-control inp_1 equiAndFacility"/>' +
                            '                </div>' +
                            '                <div class="div_3">' +
                            '                    <label class="span_1">说明<span style="color: #D52525">*</span>：</label>' +
                            '                    <input type="text"  placeholder="说明" value="' + item.explain + '" class="form-control inp_1 explain"/>' +
                            '                </div>' +
                            '</div>';
                    });

                    //实习就业单位汇总
                    employer = JSON.parse(res.orgNews.employer);
                    // console.log("站点数据：" , employer);
                    var sxjydw = '';
                    var sc3 = '';
                    employer.forEach(function (item, index) {
                        if (employer.length > 1) {
                            if (index != 0) {
                                console.log("长度 = ", index);
                                sc3 = '<span class="del delsxjydw" id="delsxjydw">删除</span>';
                            } else {
                                sc3 = '';
                            }
                        }
                        sxjydw += '<div class="sxjydw">' +
                            '                <div class="div_3">' +
                            '                    <label class="span_1">单位名称<span style="color: #D52525">*</span>：</label>' +
                            '                    <input type="text" value="' + item.dwName + '"  placeholder="单位名称" class="form-control inp_1 dwName"/>' + sc3 +
                            '                </div>' +
                            '                <div class="div_3">' +
                            '                    <label class="span_1">单位负责人<span style="color: #D52525">*</span>：</label>' +
                            '                    <input type="text"  placeholder="单位负责人" value="' + item.dwUser + '" class="form-control inp_1 dwUser"/>' +
                            '                </div>' +
                            '                <div class="div_3">' +
                            '                    <label class="span_1">联系电话<span style="color: #D52525">*</span>：</label>' +
                            '                    <input type="text"  placeholder="联系电话" value="' + item.dwMobile + '" class="form-control inp_1 dwMobile"/>' +
                            '                </div>' +
                            '                <div class="div_3">' +
                            '                    <label class="span_1">实习就业负责人<span style="color: #D52525">*</span>：</label>' +
                            '                    <input type="text"  placeholder="实习就业负责人" value="' + item.jyUser + '" class="form-control inp_1 jyUser"/>' +
                            '                </div>' +
                            '                <div class="div_3">' +
                            '                    <label class="span_1">联系电话<span style="color: #D52525">*</span>：</label>' +
                            '                    <input type="text"  placeholder="联系电话" value="' + item.jyMobile + '" class="form-control inp_1 jyMobile"/>' +
                            '                </div>' +
                            '                <div class="div_3">' +
                            '                    <label class="span_1">拟招聘人数<span style="color: #D52525">*</span>：</label>' +
                            '                    <input type="number"  placeholder="拟招聘人数(人)" value="' + item.zpNum + '" class="form-control inp_1 zpNum"/>' +
                            '                </div>' +
                            '                <div class="div_3">' +
                            '                    <label class="span_1">拟招聘岗位<span style="color: #D52525">*</span>：</label>' +
                            '                    <input type="text"  placeholder="拟招聘岗位" value="' + item.zpPost + '" class="form-control inp_1 zpPost"/>' +
                            '                </div>' +
                            '                <div class="div_3">' +
                            '                    <label class="span_1">薪酬<span style="color: #D52525">*</span>：</label>' +
                            '                    <input type="text"  placeholder="薪酬" value="' + item.emolument + '" class="form-control inp_1 emolument"/>' +
                            '                </div>' +
                            '</div>';
                    });
                    info =
                        '            <div id="kptd">' + kptd + '</div>' +
                        '            <div>' +
                        '                <span><input type="button" onclick="insert();" value="新增" class="addBtn" /></span>' +
                        '            </div>' +
                        '            <div class="line">考评场地设备</div>' +
                        '            <div id="kpcdsb">' + kpcdsb + '</div>' +
                        '            <div>' +
                        '                <span><input type="button" onclick="insert1();" value="新增" class="addBtn" /></span>' +
                        '            </div>' +
                        '            <div class="line">实习就业单位汇总</div>' +
                        '            <div id="sxjydw">' + sxjydw + '</div>' +
                        '            <div>' +
                        '                <span><input type="button" onclick="insert2();" value="新增" class="addBtn" /></span>' +
                        '            </div>' +
                        '            <div class="div_3">' +
                        '                <label class="span_1">承诺书<span style="color: #D52525">*</span>：</label>' +
                        '                <button type="button" class="btn inp_1" style="margin-top: 20px" id="btnUpload">' +
                        '                    <i class="fa fa-cloud"></i>请盖章扫描后上传' +
                        '                </button>' +
                        '                <input type="text" value="' + res.orgRole.enclosure + '" style="opacity:0;width: 1px;" value="" id="enclosure" name="enclosure"/>' +
                        '                <span id="test">' + subFileName(res.orgRole.enclosure) + '</span>' +
                        '            </div>' +
                        '            <div class="div_3">' +
                        '                <label class="span_1">承诺书模板下载：</label>' +
                        '                <label style="height: 50px;float: left;margin: 20px 10px auto auto;font-size: 16px;line-height: 50px;">' +
                        '                    <a target="_blank" style="color: blue" download href="' + cnFile + '">' + cnTitle + '</a>' +
                        '                </label>' +
                        '            </div>' +
                        '            <div class="div_3">' +
                        '                <button class="form-control but_1 send" type="button">提交审核</button>' +
                        '                <button class="form-control but_1" type="button" onclick="saveCao()">保存草稿</button>' +
                        '            </div>';
                } else {
                    info =
                        '            <div id="kptd">' +
                        '               <div class="kptd">' +
                        '                   <div class="div_3">' +
                        '                        <label class="span_1">姓名<span style="color: #D52525">*</span>：</label>' +
                        '                        <input type="text" placeholder="请输入姓名"  class="form-control inp_1 khName"/>' +
                        '                    </div>' +
                        '                    <div class="div_3">' +
                        '                        <label class="span_1">职称<span style="color: #D52525">*</span>：</label>' +
                        '                        <input type="text"  placeholder="职称" class="form-control inp_1 jobName"/>' +
                        '                    </div>' +
                        '                    <div class="div_3">' +
                        '                        <label class="span_1">职务<span style="color: #D52525">*</span>：</label>' +
                        '                        <input type="text"  placeholder="职务"  class="form-control inp_1 position"/>' +
                        '                    </div>' +
                        '                    <div class="div_3">' +
                        '                        <label class="span_1">考评岗位<span style="color: #D52525">*</span>：</label>' +
                        '                        <select class="form-control inp_1 kpPost">' +
                        '                            <option value="">请选择岗位</option>' +
                        '                            <option value="主任">主任</option>' +
                        '                            <option value="副主任">副主任</option>' +
                        '                            <option value="考务考评员">考务考评员</option>' +
                        '                            <option value="考务技术员">考务技术员</option>' +
                        '                        </select>' +
                        '                    </div>' +
                        '                    <div class="div_3">' +
                        '                        <label class="span_1">联系电话<span style="color: #D52525">*</span>：</label>' +
                        '                        <input type="text"  placeholder="联系电话"  class="form-control inp_1 kpMobile"/>' +
                        '                    </div>' +
                        '                    <div class="div_3">' +
                        '                        <label class="span_1">备注：</label>' +
                        '                        <input type="text"  placeholder="备注"  class="form-control inp_1 kpRemark"/>' +
                        '                    </div>' +
                        '               </div>' +
                        '            </div>' +
                        '            <div>' +
                        '                <span><input type="button" onclick="insert();" value="新增" class="addBtn" /></span>' +
                        '            </div>' +
                        '            <div class="line">考评场地设备</div>' +
                        '            <div id="kpcdsb">' +
                        '               <div class="kpcdsb">' +
                        '                <div class="div_3">' +
                        '                    <label class="span_1">场地<span style="color: #D52525">*</span>：</label>' +
                        '                    <input type="text" placeholder="场地"class="form-control inp_1 kpSite"/>' +
                        '                </div>' +
                        '                <div class="div_3">' +
                        '                    <label class="span_1">位置<span style="color: #D52525">*</span>：</label>' +
                        '                    <input type="text"  placeholder=""  class="form-control cd college"/>学院' +
                        '                    <input type="text"  placeholder=""  class="form-control dong ridgepole"/>栋' +
                        '                    <input type="text"  placeholder=""   class="form-control jshi classroomNum"/>号教室' +
                        '                </div>' +
                        '                <div class="div_3">' +
                        '                    <label class="span_1">设备及设施<span style="color: #D52525">*</span>：</label>' +
                        '                    <input type="text"  placeholder="设备及设施"   class="form-control inp_1 equiAndFacility"/>' +
                        '                </div>' +
                        '                <div class="div_3">' +
                        '                    <label class="span_1">说明<span style="color: #D52525">*</span>：</label>' +
                        '                    <input type="text"  placeholder="说明"   class="form-control inp_1 explain"/>' +
                        '                </div>' +
                        '               </div>' +
                        '           </div>' +
                        '            <div>' +
                        '                <span><input type="button" onclick="insert1();" value="新增" class="addBtn" /></span>' +
                        '            </div>' +
                        '            <div class="line">实习就业单位汇总</div>' +
                        '            <div id="sxjydw">' +
                        '               <div class="sxjydw">' +
                        '                <div class="div_3">' +
                        '                    <label class="span_1">单位名称<span style="color: #D52525">*</span>：</label>' +
                        '                    <input type="text"    placeholder="单位名称" class="form-control inp_1 dwName"/>' +
                        '                </div>' +
                        '                <div class="div_3">' +
                        '                    <label class="span_1">单位负责人<span style="color: #D52525">*</span>：</label>' +
                        '                    <input type="text"  placeholder="单位负责人"   class="form-control inp_1 dwUser"/>' +
                        '                </div>' +
                        '                <div class="div_3">' +
                        '                    <label class="span_1">联系电话<span style="color: #D52525">*</span>：</label>' +
                        '                    <input type="text"  placeholder="联系电话"   class="form-control inp_1 dwMobile"/>' +
                        '                </div>' +
                        '                <div class="div_3">' +
                        '                    <label class="span_1">实习就业负责人<span style="color: #D52525">*</span>：</label>' +
                        '                    <input type="text"  placeholder="实习就业负责人"   class="form-control inp_1 jyUser"/>' +
                        '                </div>' +
                        '                <div class="div_3">' +
                        '                    <label class="span_1">联系电话<span style="color: #D52525">*</span>：</label>' +
                        '                    <input type="text"  placeholder="联系电话"   class="form-control inp_1 jyMobile"/>' +
                        '                </div>' +
                        '                <div class="div_3">' +
                        '                    <label class="span_1">拟招聘人数<span style="color: #D52525">*</span>：</label>' +
                        '                    <input type="number"  placeholder="拟招聘人数(人)"   class="form-control inp_1 zpNum"/>' +
                        '                </div>' +
                        '                <div class="div_3">' +
                        '                    <label class="span_1">拟招聘岗位<span style="color: #D52525">*</span>：</label>' +
                        '                    <input type="text"  placeholder="拟招聘岗位"   class="form-control inp_1 zpPost"/>' +
                        '                </div>' +
                        '                <div class="div_3">' +
                        '                    <label class="span_1">薪酬<span style="color: #D52525">*</span>：</label>' +
                        '                    <input type="text"  placeholder="薪酬"   class="form-control inp_1 emolument"/>' +
                        '                </div>' +
                        '               </div>' +
                        '            </div>' +
                        '            <div>' +
                        '                <span><input type="button" onclick="insert2();" value="新增" class="addBtn" /></span>' +
                        '            </div>' +
                        '            <div class="div_3">' +
                        '                <label class="span_1">承诺书<span style="color: #D52525">*</span>：</label>' +
                        '                <button type="button" class="btn inp_1" style="margin-top: 20px" id="btnUpload">' +
                        '                    <i class="fa fa-cloud"></i>请盖章扫描后上传' +
                        '                </button>' +
                        '                <input type="text" style="opacity:0;width: 1px;" value="" id="enclosure" name="enclosure"/>' +
                        '                <span id="test"></span>' +
                        '            </div>' +
                        '            <div class="div_3">' +
                        '                <label class="span_1">承诺书模板下载：</label>' +
                        '                <label style="height: 50px;float: left;margin: 20px 10px auto auto;font-size: 16px;line-height: 50px;">' +
                        '                    <a target="_blank" style="color: blue" download href="' + cnFile + '">' + cnTitle + '</a>' +
                        '                </label>' +
                        '            </div>' +
                        '            <div class="div_3">' +
                        '                <button class="form-control but_1 send" type="button">提交审核</button>' +
                        '                <button class="form-control but_1" type="button" onclick="saveCao()">保存草稿</button>' +
                        '            </div>';
                }

            } else {
                $('#adre').citys({province: "请选择"});
                info =
                    '            <div id="kptd">' +
                    '               <div class="kptd">' +
                    '                   <div class="div_3">' +
                    '                        <label class="span_1">姓名<span style="color: #D52525">*</span>：</label>' +
                    '                        <input type="text" placeholder="请输入姓名"  class="form-control inp_1 khName"/>' +
                    '                    </div>' +
                    '                    <div class="div_3">' +
                    '                        <label class="span_1">职称<span style="color: #D52525">*</span>：</label>' +
                    '                        <input type="text"  placeholder="职称" class="form-control inp_1 jobName"/>' +
                    '                    </div>' +
                    '                    <div class="div_3">' +
                    '                        <label class="span_1">职务<span style="color: #D52525">*</span>：</label>' +
                    '                        <input type="text"  placeholder="职务"  class="form-control inp_1 position"/>' +
                    '                    </div>' +
                    '                    <div class="div_3">' +
                    '                        <label class="span_1">考评岗位<span style="color: #D52525">*</span>：</label>' +
                    '                        <select class="form-control inp_1 kpPost">' +
                    '                            <option value="">请选择岗位</option>' +
                    '                            <option value="主任">主任</option>' +
                    '                            <option value="副主任">副主任</option>' +
                    '                            <option value="考务考评员">考务考评员</option>' +
                    '                            <option value="考务技术员">考务技术员</option>' +
                    '                        </select>' +
                    '                    </div>' +
                    '                    <div class="div_3">' +
                    '                        <label class="span_1">联系电话<span style="color: #D52525">*</span>：</label>' +
                    '                        <input type="text"  placeholder="联系电话"  class="form-control inp_1 kpMobile"/>' +
                    '                    </div>' +
                    '                    <div class="div_3">' +
                    '                        <label class="span_1">备注：</label>' +
                    '                        <input type="text"  placeholder="备注"  class="form-control inp_1 kpRemark"/>' +
                    '                    </div>' +
                    '               </div>' +
                    '            </div>' +
                    '            <div>' +
                    '                <span><input type="button" onclick="insert();" value="新增" class="addBtn" /></span>' +
                    '            </div>' +
                    '            <div class="line">考评场地设备</div>' +
                    '            <div id="kpcdsb">' +
                    '               <div class="kpcdsb">' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">场地<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text" placeholder="场地"class="form-control inp_1 kpSite"/>' +
                    '                </div>' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">位置<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text"  placeholder=""  class="form-control cd college"/>学院' +
                    '                    <input type="text"  placeholder=""  class="form-control dong ridgepole"/>栋' +
                    '                    <input type="text"  placeholder=""   class="form-control jshi classroomNum"/>号教室' +
                    '                </div>' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">设备及设施<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text"  placeholder="设备及设施"   class="form-control inp_1 equiAndFacility"/>' +
                    '                </div>' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">说明<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text"  placeholder="说明"   class="form-control inp_1 explain"/>' +
                    '                </div>' +
                    '               </div>' +
                    '           </div>' +
                    '            <div>' +
                    '                <span><input type="button" onclick="insert1();" value="新增" class="addBtn" /></span>' +
                    '            </div>' +
                    '            <div class="line">实习就业单位汇总</div>' +
                    '            <div id="sxjydw">' +
                    '               <div class="sxjydw">' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">单位名称<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text"    placeholder="单位名称" class="form-control inp_1 dwName"/>' +
                    '                </div>' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">单位负责人<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text"  placeholder="单位负责人"   class="form-control inp_1 dwUser"/>' +
                    '                </div>' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">联系电话<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text"  placeholder="联系电话"   class="form-control inp_1 dwMobile"/>' +
                    '                </div>' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">实习就业负责人<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text"  placeholder="实习就业负责人"   class="form-control inp_1 jyUser"/>' +
                    '                </div>' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">联系电话<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text"  placeholder="联系电话"   class="form-control inp_1 jyMobile"/>' +
                    '                </div>' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">拟招聘人数<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="number"  placeholder="拟招聘人数(人)"   class="form-control inp_1 zpNum"/>' +
                    '                </div>' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">拟招聘岗位<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text"  placeholder="拟招聘岗位"   class="form-control inp_1 zpPost"/>' +
                    '                </div>' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">薪酬<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text"  placeholder="薪酬"   class="form-control inp_1 emolument"/>' +
                    '                </div>' +
                    '               </div>' +
                    '            </div>' +
                    '            <div>' +
                    '                <span><input type="button" onclick="insert2();" value="新增" class="addBtn" /></span>' +
                    '            </div>' +
                    '            <div class="div_3">' +
                    '                <label class="span_1">承诺书<span style="color: #D52525">*</span>：</label>' +
                    '                <button type="button" class="btn inp_1" style="margin-top: 20px" id="btnUpload">' +
                    '                    <i class="fa fa-cloud"></i>请盖章扫描后上传' +
                    '                </button>' +
                    '                <input type="text" style="opacity:0;width: 1px;" value="" id="enclosure" name="enclosure"/>' +
                    '                <span id="test"></span>' +
                    '            </div>' +
                    '            <div class="div_3">' +
                    '                <label class="span_1">承诺书模板下载：</label>' +
                    '                <label style="height: 50px;float: left;margin: 20px 10px auto auto;font-size: 16px;line-height: 50px;">' +
                    '                    <a target="_blank" style="color: blue" download href="' + cnFile + '">' + cnTitle + '</a>' +
                    '                </label>' +
                    '            </div>' +
                    '            <div class="div_3">' +
                    '                <button class="form-control but_1 send" type="button">提交审核</button>' +
                    '                <button class="form-control but_1" onclick="saveCao()" type="button">保存草稿</button>' +
                    '            </div>';

            }

            $('#info').html(info);

            // if (res.orgRole != null) {
            //     if (res.orgRole.checkerState == 4) {
            //         saveCao();
            //     }
            // }


            $('.delkpcd').click(function () {
                $(this).parent('.div_3').parent('.kpcdsb').remove()
            })
            $('.delkptd').click(function () {
                $(this).parent('.div_3').parent('.kptd').remove()
            })
            $('.delsxjydw').click(function () {
                $(this).parent('.div_3').parent('.sxjydw').remove()
            })
            layui.use('upload', function () {
                var upload = layui.upload;
                //执行实例
                upload.render({
                    elem: '#btnUpload', //绑定元素
                    url: '/jzApi/utils/fileImprot', //上传接口
                    size: 1000,
                    // accept: 'images',
                    exts: 'jpg|png|jpeg|pdf',
                    accept: 'file',
                    done: function (r) {
                        $("#enclosure").val(r.data);
                        $("#test").html(subFileName(r.data));
                    },
                    error: function (r) {
                        layer.msg(r.msg);
                    }
                });
            });
            layui.use('upload', function () {
                var upload = layui.upload;
                //执行实例
                upload.render({
                    elem: '#btnUpload1', //绑定元素
                    url: '/jzApi/utils/fileImprot', //上传接口
                    size: 1000,
                    accept: 'images',
                    done: function (r) {
                        $("#cachet").val(r.data);
                        $("#test1").html(subFileName(r.data));
                    },
                    error: function (r) {
                        layer.msg(r.msg);
                    }
                });
            });


            $('.send').click(function () {
                if ($('#name').val() == "") {
                    layer.msg("单位名称不能为空");
                    return false;
                }
                if ($('#numberOfExaminees').val() == "") {
                    layer.msg("已批准的考核计划(人)不能为空");
                    return false;
                }
                if ($('#enclosure').val() == "") {
                    layer.msg("请上传承诺书");
                    return false;
                }

                //------------------考评团队---------------------\\
                var teamList = [];
                var kptd = true;
                $(".kptd").each(function (item, index) {
                    var khName = $(this).find(".khName").val();
                    var jobName = $(this).find(".jobName").val();
                    var position = $(this).find('.position').val();
                    var kpPost = $(this).find('.kpPost').val();
                    var kpMobile = $(this).find('.kpMobile').val();
                    var kpRemark = $(this).find('.kpRemark').val();
                    if (khName == '' || jobName == '' || position == '' || kpPost == '' || kpMobile == '') {
                        layer.msg('考评团队信息填写不完整');
                        kptd = false;
                    }
                    teamList.push({
                        khName: khName,
                        jobName: jobName,
                        position: position,
                        kpPost: kpPost,
                        kpMobile: kpMobile,
                        kpRemark: kpRemark
                    });
                })
                if (kptd == false) {
                    return kptd;
                }

                //------------------考评场地设备---------------------\\
                var equipmentList = [];
                var kpcdsb = true;
                $(".kpcdsb").each(function (item, index) {
                    var kpSite = $(this).find(".kpSite").val();
                    var college = $(this).find(".college").val();
                    var ridgepole = $(this).find('.ridgepole').val();
                    var classroomNum = $(this).find('.classroomNum').val();
                    var equiAndFacility = $(this).find('.equiAndFacility').val();
                    var explain = $(this).find('.explain').val();
                    if (kpSite == '' || college == '' || ridgepole == '' || classroomNum == '' || equiAndFacility == '' || explain == '') {
                        layer.msg('考评场地设备信息填写不完整');
                        kpcdsb = false;
                    }
                    equipmentList.push({
                        kpSite: kpSite,
                        college: college,
                        ridgepole: ridgepole,
                        classroomNum: classroomNum,
                        equiAndFacility: equiAndFacility,
                        explain: explain
                    });
                })
                if (kpcdsb == false) {
                    return kpcdsb;
                }

                //------------------实习就业单位汇总---------------------\\
                var employerList = [];
                var sxjydw = true;
                $(".sxjydw").each(function (item, index) {
                    var dwName = $(this).find(".dwName").val();
                    var dwUser = $(this).find(".dwUser").val();
                    var dwMobile = $(this).find('.dwMobile').val();
                    var jyUser = $(this).find('.jyUser').val();
                    var jyMobile = $(this).find('.jyMobile').val();
                    var zpNum = $(this).find('.zpNum').val();
                    var zpPost = $(this).find('.zpPost').val();
                    var emolument = $(this).find('.emolument').val();
                    if (dwName == '' || dwUser == '' || dwMobile == '' || jyUser == '' || jyMobile == '' || zpNum == ''
                        || zpPost == '' || emolument == '') {
                        layer.msg('实习就业单位汇总信息填写不完整');
                        sxjydw = false;
                    }
                    employerList.push({
                        dwName: dwName,
                        dwUser: dwUser,
                        dwMobile: dwMobile,
                        jyUser: jyUser,
                        jyMobile: jyMobile,
                        zpNum: zpNum,
                        zpPost: zpPost,
                        emolument: emolument
                    });
                })
                if (sxjydw == false) {
                    return sxjydw;
                }

                ajaxToken("/jzApi/organizion/addExaminationPoint", 'POST', {
                    name: $('#name').val(),
                    numberOfExaminees: $('#numberOfExaminees').val(),
                    enclosure: $('#enclosure').val(),
                    cachet: null,
                    team: JSON.stringify(teamList),
                    equipment: JSON.stringify(equipmentList),
                    employer: JSON.stringify(employerList),
                    state: 0,
                    province: $("#province").val(),
                    profileName: $("#profileName").val()
                }, function (r) {
                    location.href = "/certificate/stationRecordList";
                });
            })
        })
    });

    function insert() {
        $('#kptd').append('<div class="kptd">' +
            '<div class="div_3">' +
            '                        <label class="span_1">姓名<span style="color: #D52525">*</span>：</label>' +
            '                        <input type="text" placeholder="请输入姓名"' +
            '                               class="form-control inp_1 khName"/>' +
            '                    <span class="del" id="del">删除</span>' +
            '                    </div>' +
            '                    <div class="div_3">' +
            '                        <label class="span_1">职称<span style="color: #D52525">*</span>：</label>' +
            '                        <input type="text"  placeholder="职称"' +
            '                               class="form-control inp_1 jobName"/>' +
            '                    </div>' +
            '                    <div class="div_3">' +
            '                        <label class="span_1">职务<span style="color: #D52525">*</span>：</label>' +
            '                        <input type="text"  placeholder="职务"' +
            '                               class="form-control inp_1 position"/>' +
            '                    </div>' +
            '                    <div class="div_3">' +
            '                        <label class="span_1">考评岗位<span style="color: #D52525">*</span>：</label>' +
            '                        <select class="form-control inp_1 kpPost">' +
            '                            <option value="">请选择岗位</option>' +
            '                            <option value="主任">主任</option>' +
            '                            <option value="副主任">副主任</option>' +
            '                            <option value="考务考评员">考务考评员</option>' +
            '                            <option value="考务技术员">考务技术员</option>' +
            '                        </select>' +
            '                    </div>' +
            '                    <div class="div_3">' +
            '                        <label class="span_1">联系电话<span style="color: #D52525">*</span>：</label>' +
            '                        <input type="text"  placeholder="联系电话"' +
            '                               class="form-control inp_1 kpMobile"/>' +
            '                    </div>' +
            '                    <div class="div_3">' +
            '                        <label class="span_1">备注：</label>' +
            '                        <input type="text"  placeholder="备注"' +
            '                               class="form-control inp_1 kpRemark"/>' +
            '                    </div>' +
            '</div>')
        $('.del').click(function () {
            $(this).parent('.div_3').parent('.kptd').remove()
        })

    }

    function insert1() {
        $('#kpcdsb').append('<div class="kpcdsb">' +
            '                <div class="div_3">' +
            '                    <label class="span_1">场地<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="场地"class="form-control inp_1 kpSite"/>' +
            '                    <span class="del" id="del">删除</span>' +
            '                </div>' +
            '                <div class="div_3">' +
            '                    <label class="span_1">位置<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder=""' +
            '                           class="form-control cd college"/>学院' +
            '                    <input type="text"  placeholder=""' +
            '                           class="form-control dong ridgepole"/>栋' +
            '                    <input type="text"  placeholder=""' +
            '                           class="form-control jshi classroomNum"/>号教室' +
            '                </div>' +
            '                <div class="div_3">' +
            '                    <label class="span_1">设备及设施<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="设备及设施"' +
            '                           class="form-control inp_1 equiAndFacility"/>' +
            '                </div>' +
            '                <div class="div_3">' +
            '                    <label class="span_1">说明<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="说明"' +
            '                           class="form-control inp_1 explain"/>' +
            '                </div>' +
            '</div>');
        $('.del').click(function () {
            $(this).parent('.div_3').parent('.kpcdsb').remove()
        })
    }

    function insert2() {
        $('#sxjydw').append('<div class="sxjydw">' +
            '                <div class="div_3">' +
            '                    <label class="span_1">单位名称<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="单位名称" class="form-control inp_1 dwName"/>' +
            '                    <span class="del" id="del">删除</span>' +
            '                </div>' +
            '                <div class="div_3">' +
            '                    <label class="span_1">单位负责人<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="单位负责人"' +
            '                           class="form-control inp_1 dwUser"/>' +
            '                </div>' +
            '                <div class="div_3">' +
            '                    <label class="span_1">联系电话<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="联系电话"' +
            '                           class="form-control inp_1 dwMobile"/>' +
            '                </div>' +
            '                <div class="div_3">' +
            '                    <label class="span_1">实习就业负责人<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="实习就业负责人"' +
            '                           class="form-control inp_1 jyUser"/>' +
            '                </div>' +
            '                <div class="div_3">' +
            '                    <label class="span_1">联系电话<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="联系电话"' +
            '                           class="form-control inp_1 jyMobile"/>' +
            '                </div>' +
            '                <div class="div_3">' +
            '                    <label class="span_1">拟招聘人数<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="拟招聘人数"' +
            '                           class="form-control inp_1 zpNum"/>' +
            '                </div>' +
            '                <div class="div_3">' +
            '                    <label class="span_1">拟招聘岗位<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="拟招聘岗位"' +
            '                           class="form-control inp_1 zpPost"/>' +
            '                </div>' +
            '                <div class="div_3">' +
            '                    <label class="span_1">薪酬<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="薪酬"' +
            '                           class="form-control inp_1 emolument"/>' +
            '                </div>' +
            '</div>');
        $('.del').click(function () {
            $(this).parent('.div_3').parent('.sxjydw').remove()
        })
    }

    function saveCao() {
        //nz_bg = window.setInterval("saveCao()", 300000);
        if ($('#name').val() == "") {
            layer.msg("单位名称不能为空");
            return false;
        }
        if ($('#numberOfExaminees').val() == "") {
            layer.msg("已批准的考核计划(人)不能为空");
            return false;
        }
        //------------------考评团队---------------------\\
        var teamList = [];
        $(".kptd").each(function (item, index) {
            var khName = $(this).find(".khName").val();
            var jobName = $(this).find(".jobName").val();
            var position = $(this).find('.position').val();
            var kpPost = $(this).find('.kpPost').val();
            var kpMobile = $(this).find('.kpMobile').val();
            var kpRemark = $(this).find('.kpRemark').val();
            teamList.push({
                khName: khName,
                jobName: jobName,
                position: position,
                kpPost: kpPost,
                kpMobile: kpMobile,
                kpRemark: kpRemark
            });
        });

        //------------------考评场地设备---------------------\\
        var equipmentList = [];
        $(".kpcdsb").each(function (item, index) {
            var kpSite = $(this).find(".kpSite").val();
            var college = $(this).find(".college").val();
            var ridgepole = $(this).find('.ridgepole').val();
            var classroomNum = $(this).find('.classroomNum').val();
            var equiAndFacility = $(this).find('.equiAndFacility').val();
            var explain = $(this).find('.explain').val();
            equipmentList.push({
                kpSite: kpSite,
                college: college,
                ridgepole: ridgepole,
                classroomNum: classroomNum,
                equiAndFacility: equiAndFacility,
                explain: explain
            });
        });

        //------------------实习就业单位汇总---------------------\\
        var employerList = [];
        $(".sxjydw").each(function (item, index) {
            var dwName = $(this).find(".dwName").val();
            var dwUser = $(this).find(".dwUser").val();
            var dwMobile = $(this).find('.dwMobile').val();
            var jyUser = $(this).find('.jyUser').val();
            var jyMobile = $(this).find('.jyMobile').val();
            var zpNum = $(this).find('.zpNum').val();
            var zpPost = $(this).find('.zpPost').val();
            var emolument = $(this).find('.emolument').val();
            employerList.push({
                dwName: dwName,
                dwUser: dwUser,
                dwMobile: dwMobile,
                jyUser: jyUser,
                jyMobile: jyMobile,
                zpNum: zpNum,
                zpPost: zpPost,
                emolument: emolument
            });
        });
        ajaxToken1("/jzApi/organizion/addExaminationPoint", 'POST', {
            name: $('#name').val(),
            numberOfExaminees: $('#numberOfExaminees').val(),
            enclosure: $('#enclosure').val(),
            cachet: null,
            team: JSON.stringify(teamList),
            equipment: JSON.stringify(equipmentList),
            employer: JSON.stringify(employerList),
            state: 4,
            province: $("#province").val(),
            profileName: $("#profileName").val()
        }, function (r) {
            if (r.code == 0) {
                layer.msg("自动保存成功", {offset: "rb"});
                //window.clearInterval(nz_bg)
            } else {
                layer.confirm(r.msg);
                //window.clearInterval(nz_bg)
            }
        })
    }
</script>
</html>